home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Date & Calendars / daily-greeting.izs < prev    next >
Text File  |  2005-09-27  |  5KB  |  140 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Daily Greeting 
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This clever little script works out what time of the day it is and gives you an appropriate greeting. It also has a small calender square to show you the day and month we are in.<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>calenders<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL DAILY GREETING:
  14.  
  15.   1.  Copy the coding into the BODY of your HTML document  -->
  16.  
  17. <!-- STEP ONE: Paste this code into the BODY of your HTML document  -->
  18.  
  19. <BODY>
  20.  
  21. <SCRIPT LANGUAGE="JavaScript">
  22.  
  23. <!-- Begin
  24. var Today=new Date();
  25. var ThisDay=Today.getDay();
  26. var ThisDate=Today.getDate();
  27. var ThisMonth=Today.getMonth()+1;
  28. var ThisYear=Today.getFullYear();  //included if you wish to insert the year
  29. function DayTxt (DayNumber) {
  30. var Day=new Array();
  31. Day[0]="Sunday";
  32. Day[1]="Monday";
  33. Day[2]="Tuesday";
  34. Day[3]="Wednesday";
  35. Day[4]="Thursday";
  36. Day[5]="Friday";
  37. Day[6]="Saturday";
  38. return Day[DayNumber];
  39. }
  40. var DayName=DayTxt(ThisDay);
  41. function MonthTxt (MonthNumber) {
  42. var Month=new Array();
  43. Month[1]="January";
  44. Month[2]="February";
  45. Month[3]="March";
  46. Month[4]="April";
  47. Month[5]="May";
  48. Month[6]="June";
  49. Month[7]="July";
  50. Month[8]="August";
  51. Month[9]="September";
  52. Month[10]="October";
  53. Month[11]="November";
  54. Month[12]="December";
  55. return Month[MonthNumber];
  56. }
  57. var MonthName=MonthTxt(ThisMonth);
  58. var d = new Date();
  59. var h = d.getHours();
  60. document.write("<TABLE BORDER=3 BGCOLOR=WHITE  WIDTH=75 HEIGHT=85 align=left>"+"<TD>"+"<p align=center>"+"<font size=-2 >"+DayName+"<br>"+"<font color=orangered size=+3 >"+ThisDate+"</font>"+"<br>"+MonthName+"<br>"+"</b>"+"</font>"+"</p>"+"</TD>"+"</TR>"+"</TABLE>");
  61. if (h < 2) document.write("<P ALIGN=center>"+"<b>"+"Good morning! Yes, it's way past midnight."+"</b>"+"</P>");
  62. else if (h < 3) document.write("<P ALIGN=center>"+"<b>"+"Good morning! Up early or working late?"+"</b>"+"</P>");
  63. else if (h < 7) document.write("<P ALIGN=center>"+"<b>"+"Good morning! Up bright and early!"+"</b>"+"</P>");
  64. else if (h < 12) document.write("<P ALIGN=center>"+"<b>"+"Good morning!"+"</b>"+"</P>");
  65. else if (h < 17) document.write("<P ALIGN=center>"+"<b>"+"Good afternoon!"+"</b>"+"</P>");
  66. else if (h < 23) document.write("<P ALIGN=center>"+"<b>"+"Good evening!"+"</b>"+"</P>");
  67. else document.write("<P ALIGN=center>"+"<b>"+"A late good evening! Not much left of it now."+"</b>"+"</P>");
  68. //  End -->
  69. </script>
  70.  
  71. <!-- END OF SCRIPT -->
  72. <!/SCRIPT>
  73.  
  74. <!PREVIEW>
  75. <!-- START OF SCRIPT -->
  76.  
  77.  
  78.  
  79. <!-- HOW TO INSTALL DAILY GREETING:
  80.  
  81.   1.  Copy the coding into the BODY of your HTML document  -->
  82.  
  83. <!-- STEP ONE: Paste this code into the BODY of your HTML document  -->
  84.  
  85. <BODY>
  86.  
  87. <SCRIPT LANGUAGE="JavaScript">
  88.  
  89. <!-- Begin
  90. var Today=new Date();
  91. var ThisDay=Today.getDay();
  92. var ThisDate=Today.getDate();
  93. var ThisMonth=Today.getMonth()+1;
  94. var ThisYear=Today.getFullYear();  //included if you wish to insert the year
  95. function DayTxt (DayNumber) {
  96. var Day=new Array();
  97. Day[0]="Sunday";
  98. Day[1]="Monday";
  99. Day[2]="Tuesday";
  100. Day[3]="Wednesday";
  101. Day[4]="Thursday";
  102. Day[5]="Friday";
  103. Day[6]="Saturday";
  104. return Day[DayNumber];
  105. }
  106. var DayName=DayTxt(ThisDay);
  107. function MonthTxt (MonthNumber) {
  108. var Month=new Array();
  109. Month[1]="January";
  110. Month[2]="February";
  111. Month[3]="March";
  112. Month[4]="April";
  113. Month[5]="May";
  114. Month[6]="June";
  115. Month[7]="July";
  116. Month[8]="August";
  117. Month[9]="September";
  118. Month[10]="October";
  119. Month[11]="November";
  120. Month[12]="December";
  121. return Month[MonthNumber];
  122. }
  123. var MonthName=MonthTxt(ThisMonth);
  124. var d = new Date();
  125. var h = d.getHours();
  126. document.write("<TABLE BORDER=3 BGCOLOR=WHITE  WIDTH=75 HEIGHT=85 align=left>"+"<TD>"+"<p align=center>"+"<font size=-2 >"+DayName+"<br>"+"<font color=orangered size=+3 >"+ThisDate+"</font>"+"<br>"+MonthName+"<br>"+"</b>"+"</font>"+"</p>"+"</TD>"+"</TR>"+"</TABLE>");
  127. if (h < 2) document.write("<P ALIGN=center>"+"<b>"+"Good morning! Yes, it's way past midnight."+"</b>"+"</P>");
  128. else if (h < 3) document.write("<P ALIGN=center>"+"<b>"+"Good morning! Up early or working late?"+"</b>"+"</P>");
  129. else if (h < 7) document.write("<P ALIGN=center>"+"<b>"+"Good morning! Up bright and early!"+"</b>"+"</P>");
  130. else if (h < 12) document.write("<P ALIGN=center>"+"<b>"+"Good morning!"+"</b>"+"</P>");
  131. else if (h < 17) document.write("<P ALIGN=center>"+"<b>"+"Good afternoon!"+"</b>"+"</P>");
  132. else if (h < 23) document.write("<P ALIGN=center>"+"<b>"+"Good evening!"+"</b>"+"</P>");
  133. else document.write("<P ALIGN=center>"+"<b>"+"A late good evening! Not much left of it now."+"</b>"+"</P>");
  134. //  End -->
  135. </script>
  136.  
  137. <!-- END OF SCRIPT -->
  138. <!/PREVIEW>
  139.  
  140. <!RELATED>NONE<!/RELATED>